<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0, width=device-width"/>
	<title>api</title>
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../css/common.css" />
	
	<style type="text/css">
	.content{
		width: 100%;
	}

	.content img {
		width: 100%;
	}
	</style>

</head>
	<body id='teletext'>
	<script id="teletext-template" type="text/x-dot-template">
	{{=it.content}}
	</script>
	<div id='teletext-content' class="content">
		
	</div>
		
	</body>
	<script type="text/javascript" src="../script/zepto.min.js"></script>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/doT.min.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	
	<script type="text/javascript">
	apiready = function(){
	    var id = api.pageParam.shopId;
	    getData(id);
	}
	    
		//获取商品信息
	function getData(id){
		
	        api.ajax({
	        url: 'http://wap.jqmao.cn/getTeletext?id='+id,
	        method: 'get',
	        dataType: 'json'
	    }, function (ret, err) {


	        if (ret) {
	  
	            var content = $api.byId('teletext-content');
	            var tpl = $api.byId('teletext-template').text;
	            var tempFn = doT.template(tpl);
	            $api.html(content,tempFn(ret));


	            
	        } else {
	            //alert(JSON.stringify(err))
	        }
	    });
	    
	}
	</script>
</html>